﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameTools.Service.ConfigServer
{
    public interface IConfigService
    {
        // 同步方法
        T LoadConfig<T>(string fileName) where T : class, new();
        void SaveConfig<T>(string fileName, T config) where T : class;
        string ImportConfigFromFile(string sourcePath, string targetFileName);

        // 异步方法
        Task<T> LoadConfigAsync<T>(string fileName) where T : class, new();
        Task SaveConfigAsync<T>(string fileName, T config) where T : class;
        Task ImportConfigFromFileAsync(string sourcePath, string targetFileName);

        Task<JObject> ImportAndLoadConfigAsync(string sourcePath, string targetFileName);
    }

}
